<template>
  <view class="container">
	  <my-navbar-top></my-navbar-top>
    <view class="title">{{detail.big_title}}</view>
	<view class="release_date">{{detail.release_date}}</view>
    <view style="padding:40rpx;flex: 1;overflow-y: auto;box-sizing: border-box;display: flex;flex-direction: column;align-items: center;">
    	<scroll-view
    	  class="list"
    	  style="height: 100%"
    	  scroll-y
    	>
    		<rich-text :nodes="detail.detail"></rich-text>
    	</scroll-view>
		
    </view>
  </view>
</template>

<script>
import api from '@/utils/api/index.js'
export default {
  name: 'NewDetail',
 
  data() {
    return {
      newId: '',
      detail: {},
    }
  },
  computed: {
    
  },
  onLoad(e) {
    console.log(e)
    this.initData(e.id)
    this.newId = e.id || ''
  },
  methods: {
      
    initData(id) {
      this.$util.showLoading()
      console.log('initData')
      this.$api
        .getNewDetail({
          id,
        })
        .then((res) => {
          console.log(res)
          this.detail = res.data
        })
    }, 
  },
  onShareAppMessage() {
    return {
      title: this.detail.name || '新品推荐详情',
      path: `/pages/new/detail/index?id=${this.detail.id}`,
      imageUrl: this.detail.cover || '/static/images/default-cover.png',
    }
  },
}
</script>

<style lang="scss" scoped>
@import './index.scss';
</style>
